// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
    const that=this;
    //获取系统信息
    const systemInfo=wx.getSystemInfoSync();
    //胶囊按钮信息
    const menuButtonInfo=wx.getMenuButtonBoundingClientRect();
    //导航栏高度=状态栏高度+44
    that.globalData.navBarHeight=systemInfo.statusBarHeight+44;
    that.globalData.menuRight=systemInfo.screenWidth-menuButtonInfo.right;
    that.globalData.menuTop=menuButtonInfo.top;
    that.globalData.menuHeight=menuButtonInfo.height;
  },
  globalData: {
    navBarHeight:0,
    menuRight:0,
    menuTop:0,
    menuHeight:0,
  }
})
